import request from '@/server'

// 获得文章列表
export const getArticleListApi = (
  page: number | string,
  size: number | string
) => {
  return request.get({
    url: `admin/share/article?page=${page}&size=${size}`
  })
}

// 修改文章内容
export const updateArticleApi = (data: any) => {
  return request.post({
    url: '/admin/share/updateArticle',
    data
  })
}

// 删除文章内容
export const deleteArticleApi = (
  id: number | string,
  detail_id: number | string
) => {
  return request.post({
    url: '/admin/share/deleteArticle',
    data: {
      id,
      detail_id
    }
  })
}

// 增加文章内容
export const addArticleApi = (data: any) => {
  return request.post({
    url: '/admin/share/addArticle',
    data
  })
}

// 获得随记列表
export const getLeftRecordList = (
  page: number | string,
  size?: number | string
) => {
  return request.get({
    url: `/admin/share/getLiftRecordAdmin?page=${page}&size=${size}`
  })
}

// 删除随记列表
export const deleteLeftRecordApi = (id: number | string) => {
  return request.delete({
    url: `/admin/share/deleteLiftRecord?id=${id}`
  })
}

// 跟新随记列表
export const updateLeftRecordApi = (data: any) => {
  return request.post({
    url: '/admin/share/updateLiftRecord',
    data
  })
}

// 增加随记内容
export const addLeftRecordApi = (data: any) => {
  return request.post({
    url: '/admin/share/addLiftRecord',
    data
  })
}
